<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>destructuring</title>
</head>
<body>
<script>
    /*
        不完全解构
    */
    // demo1
    /*let [a,b]=[1,2,3];
    console.log(a)
    console.log(b)*/
    // demo2
    /*let [a,b,c,d]=[1,2,3];
    console.log(a)
    console.log(b)
    console.log(c)
    console.log(d) /!*undefind*!/*/
    // demo3
    let [a,[b],c]=[1,[2,3],4];
    console.log(a) /*1*/
    console.log(b) /*2*/
    console.log(c) /*4*/
    // demo4
    let [a,b,c]=[1,[2,3],4];
    console.log(a) /*1*/
    console.log(b) /*[2,3]*/
    console.log(c) /*4*/
</script>
</body>
</html>